Skip to content

Fix isDevMode not checking for compiled Bun binary#699

Merged
RhysSullivan merged 2 commits intoRhysSullivan:mainfrom
grfwings:fix-isDevMode-check
May 10, 2026
Merged

Fix isDevMode not checking for compiled Bun binary#699
RhysSullivan merged 2 commits intoRhysSullivan:mainfrom
grfwings:fix-isDevMode-check

Conversation

@grfwings
Copy link
Copy Markdown
Contributor

@grfwings grfwings commented May 7, 2026

Compiled Bun executables expose process.argv[1] as an embedded path, /$bunfs/root/main.js. The CLI was classifying any .js entrypoint as dev mode, so background daemon startup tried to spawn a child process with:

  bun run /$bunfs/root/main.js daemon run --foreground ...

That path only exists inside the running binary, so the detached child exited immediately and the parent timed out waiting for the daemon to become reachable.

Changes:

  • add isDevCliEntrypoint() helper in apps/cli/src/daemon.ts
  • exclude Bun embedded /$bunfs/ entrypoints from dev mode detection
  • switch apps/cli/src/main.ts to use the shared helper
  • add regression coverage for Bun embedded entrypoints in tests/daemon-bootstrap.test.ts

@grfwings grfwings marked this pull request as ready for review May 7, 2026 08:14
# Conflicts:
#	apps/cli/src/daemon.ts
@RhysSullivan RhysSullivan merged commit 1be1b70 into RhysSullivan:main May 10, 2026
6 checks passed
@RhysSullivan RhysSullivan mentioned this pull request May 10, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants